#include <asm.h>
.intel_syntax noprefix

/// <summary>
/// SSE2 Version
/// int GalRectMin(RectanglePtr dst, RectanglePtr src);
/// </summary>
.globl GalRectMin
.type GalRectMin, @function
GalRectMin:
	push ebp
	mov ebp, esp
	mov ecx, [ebp+8]
	mov edx, [ebp+12]
	movups xmm0, [ecx]
	movups xmm1, [edx]
	minps xmm0, xmm1
	movups [ecx], xmm0
	pop ebp
	emms
	ret

/// <summary>
/// SSE2 Version
/// int GalRectMax(RectanglePtr dst, RectanglePtr src);
/// </summary>
.globl GalRectMax
.type GalRectMax, @function
GalRectMax:
	push ebp
	mov ebp, esp
	mov ecx, [ebp+8]
	mov edx, [ebp+12]
	movups xmm0, [ecx]
	movups xmm1, [edx]
	maxps xmm0, xmm1
	movups [ecx], xmm0
	pop ebp
	emms
	ret

/// <summary>
/// int GalRectUnion(RectanglePtr dst, RectanglePtr src);
/// </summary>
.globl GalRectUnion
.type GalRectUnion, @function
GalRectUnion:
	push ebp
	mov ebp, esp
	mov ecx, [ebp+8]
	mov edx, [ebp+12]
	movups xmm0, [ecx]
	movups xmm1, [edx]
	maxss xmm0, xmm1
	movups [ecx], xmm0
	pop ebp
	emms
	ret

/// <summary>
/// int GalRectIntersect(RectanglePtr dst, RectanglePtr src);
/// </summary>
.globl GalRectIntersect
.type GalRectIntersect, @function
GalRectIntersect:
	push ebp
	mov ebp, esp

	pop ebp
	emms
	ret
